package com.situ.ssm.controller;

import com.situ.ssm.pojo.Student;
import com.situ.ssm.pojo.query.StudentQuery;
import com.situ.ssm.service.IStudentService;
import com.situ.ssm.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private IStudentService studentService;

    @ResponseBody
    @RequestMapping("/list")
    public Result list(StudentQuery studentQuery) {
        System.out.println("StudentController.list");
        List<Student> list = studentService.list(studentQuery);
        return Result.ok(list);
    }
}
